#include<bits/stdc++.h>
using namespace std;
int tmp, n, cur, cnt;
int a[100005], b[100005];
int main(){
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    memset(a, 0, sizeof(a));
    cin >> n;
    for(int i = 1; i <= n; i++){
        cur = 0;
        cin >> cur;
        a[cur]++;
        b[cur]++;
    }
    tmp = 1;
    while(a[tmp] == 0) tmp++;
    for(int i = tmp + 1; i <= 100005; i++){
        while((b[i] != 0) && i > tmp){
            if(a[tmp]){
                a[tmp]--;
                b[i]--;
            }
            else if(a[tmp] == 0){
                 while(a[tmp] == 0) tmp++;
            }
        }
    }
    cnt = 0;
    for(int i = 1; i <= 100005; i++) cnt += a[i];
    cout << cnt;
    return 0;
}
